function classWish() {}

classWish.prototype.category = null;
classWish.prototype.additionalComents = null;


classWish.prototype.set_category = function (categoryName, categoryType) {
    this.category = new classCategory();
    this.category.set_name(categoryName);
    this.category.set_type(categoryType);
}


classWish.prototype.set_additional_comments = function (additionalComents) {
    this.additionalComents = additionalComents;
}


classWish.prototype.save  = function () {

    Wishlist = Backbone.Model.extend({
        url: 'http://localhost:8080/soshal/api/1.0/user/' + currSessionID + '/wishlist',
        defaults: {
            category: '',
            additionalComments: '',
            status:0
        }
    });

    var currentWish = {category: this.category,
        additionalComments: this.additionalComents
    };

    mywish = new Wishlist();

    mywish.save(currentWish, {
        wait: true,
        success: function(mywish, response) {
            window.location = "user/me";
        },
        error: function(mywish, response) {
            alert("error");
        }
    });
}

classWish.prototype.update  = function (currSessionID,wishid) {

    Wishlist = Backbone.Model.extend({
        url: 'http://localhost:8080/soshal/api/1.0/user/' + currSessionID + '/updatewish',
        defaults: {
            id:'',
            status: 0
        }
    });

    var currentWish = {
        status:1,
        id:wishid
    };

    mywish = new Wishlist();

    mywish.save(currentWish, {
        wait: true,
        success: function(wishlist, response) {
            window.location.reload();
        },
        error: function(wishlist, response) {
            alert("error");
        }
    });
}